package com.wan.zuochengyun_v2.stack_queue;

import java.util.Arrays;
import java.util.LinkedList;




public class MyLinkedList {
    public static void main(String[] args) {
        LinkedList<Integer> list = new LinkedList<>();
        list.addAll(Arrays.asList(1, 2, 3, 4, 5));
        /**
         * List
         */
        System.out.println(list.add(6));           //true
        list.addFirst(7);                       //void
        list.addLast(8);                        //void
        System.out.println(list.element());         //NoSuchElementException
        System.out.println(list.getFirst());        //NoSuchElementException
        System.out.println(list.getLast());         //NoSuchElementException
        System.out.println(list.remove());          //NoSuchElementException
        System.out.println(list.removeFirst());     //NoSuchElementException
        System.out.println(list.removeLast());      //NoSuchElementException

    }
}
